package com.minivision.fdiot.rate.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import lombok.Getter;
import lombok.Setter;

/**
 * 限流参数配置
 * @author hughzhao
 * @2018年3月2日
 */
@Getter
@Setter
@Component
@ConfigurationProperties("rate")
public class RateLimitingProperties {

    //是否开启限流
    private boolean enabled;

    //是否开启黑白名单限制
    private boolean inspectionEnabled;

    //时间单位（秒）
    private int period;

    //请求数
    private int limit;
    
    //是否开启令牌
    private boolean limiterEnabled;
    
    //每秒令牌数
    private int permitsPerSecond;

    //过载提示信息
    private String exceedMessage;

}
